home *** CD-ROM | disk | FTP | other *** search
- Path: grimsel.zurich.ibm.com!usenet
- From: Keith Whittingham <wgk@zurich.ibm.com>
- Newsgroups: comp.lang.c++
- Subject: downcast with virtual base class - illegal but why
- Date: Tue, 16 Apr 1996 14:52:23 -0700
- Organization: IBM Zurich Research Laboratory
- Message-ID: <31741697.7881@zurich.ibm.com>
- NNTP-Posting-Host: pine.zurich.ibm.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (Win16; I)
-
- I am reminded of this problem from a recent post but lost the post.
-
- class Base { };
- class Der : public virtual Base {};
-
- Der d;
- Base *b = &d;
- Der *dp = (Der *)b; // error
-
- I know the downcast from a virtual base class is illegal but why?
-
-
- --
- Keith Whittingham
- wgk@zurich.ibm.com
-